package easy;

public class Solution_771 {

    public int numJewelsInStones(String jewels, String stones) {
        boolean[] flags = new boolean[60];
        char[] chars = jewels.toCharArray();
        for (char c : chars) {
            flags[c - 'A'] = true;
        }
        int count = 0;
        char[] array = stones.toCharArray();
        for (char c : array) {
            if (flags[c-'A']) {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        Solution_771 model = new Solution_771();
        System.out.println(model.numJewelsInStones("aA", "aAAbbbb"));
        System.out.println(model.numJewelsInStones("z", "ZZ"));
    }
}
